﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="Project_mfa.Admin.Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphcontent" runat="server">
    <asp:Panel ID="paneelPanel" runat="server">
        <asp:Panel ID="selectuserpanel" runat="server" CssClass="selectuser">
            <div class="row">
                <div class="col col_16">
                    <h2>Search for a user</h2>
                    <br />
                </div>
            </div>
            <!-- Begin autocompletion -->
            <ajaxToolkit:ToolkitScriptManager ID="tsm1" runat="server" />
            <div class="row">
                <div class="col col_6">
                    U are logged in as: <%= HttpContext.Current.User.Identity.Name %>
                </div>
                <div class="col col_6">
                    <asp:LoginStatus runat="server" ID="userStatus" />
                </div>
            </div>
            <div class="row">
                <div class="col col_16">
                    <hr />
                </div>
            </div>
            <div class="row">
                <div class="col col_3">
                    <asp:TextBox ID="users" runat="server" Text="Search user" CssClass="users"></asp:TextBox>
                </div>
                <div class="col col_3">
                    <asp:Button ID="goUser" runat="server" Text="Select" OnClick="goUser_Click" />
                </div>
            </div>
            <ajaxToolkit:AutoCompleteExtender CompletionListItemCssClass="compUsers" ServiceMethod="compUsers" ID="ace1" TargetControlID="users" runat="server" UseContextKey="True" CompletionInterval="200" />
            <div class="row">
                <div class="col col_16">
                    <hr />
                </div>
            </div>
            <!-- end autocompletion -->
            <!-- user edit -->
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="UserName" runat="server" Text="Selected user: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:TextBox ID="txtUserName" Enabled="false" Width="200" runat="server"></asp:TextBox>
                </div>
            </div>
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="Mail" runat="server" Text="Mail: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:TextBox ID="txtMail" Width="200" runat="server"></asp:TextBox>
                </div>
                <div class="col col_3">
                    <asp:Button ID="changeMail" runat="server" Text="Change mail" OnClick="changeMail_Click" />
                </div>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtMail"
                    ErrorMessage="Not a Valid Email Address" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                    ValidationGroup="CreateUserForm"></asp:RegularExpressionValidator>

            </div>
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="Password" runat="server" Text="Reset password: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:Button ID="resetPassword" runat="server" Text="Reset password" OnClick="resetPassword_Click" />
                </div>
            </div>
            <div class="row">
                <div class="col col_16">
                    <hr />
                </div>
            </div>
            <div class="row">
                <div class="col col_16">
                    <asp:Label ID="Role" runat="server" Text="Role"></asp:Label>

                    <asp:RadioButtonList ID="RoleRB" runat="server" DataTextField="RoleName" DataValueField="RoleName">
                        <asp:ListItem ID="rdoAdmin" Value="Admin">Admin</asp:ListItem>
                        <asp:ListItem ID="rdoLees" Value="UserLees">UserLees</asp:ListItem>
                        <asp:ListItem ID="rdoSchijf" Value="UserSchrijf">UserSchrijf</asp:ListItem>
                    </asp:RadioButtonList>
                    <asp:Button ID="changeRole" runat="server" Text="Change role" OnClick="changeRole_Click" />
                </div>
            </div>
            <div class="row">
                <div class="col col_16">
                    <hr />
                </div>
            </div>
            <div class="row">
                <div class="col col_16">
                    <asp:Button ID="DeleteUser" runat="server" Text="Delete User" OnClick="DeleteUser_Click" />
                </div>
            </div>

            <div class="row">
                <div class="col col_16">
                    <hr />
                </div>
            </div>
            <!-- end user edit -->
        </asp:Panel>
        <asp:Panel ID="createuserpanel" runat="server" CssClass="createuser">

            <!-- start create user -->
            <div class="row">
                <div class="col col_16">
                    <h3>Create user</h3>
                    <br />
                </div>
            </div>
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="lblName1" runat="server" Text="Username: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:TextBox ID="txtNewName1" Width="200" runat="server"></asp:TextBox>
                </div>
            </div>
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="lblPass1" runat="server" Text="Password: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:TextBox ID="txtNewPass1" TextMode="Password" Width="200" runat="server"></asp:TextBox>
                </div>
            </div>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                ControlToValidate="txtNewPass1"
                ValidationExpression="(?=.{8,})[a-zA-Z]+[^a-zA-Z]+|[^a-zA-Z]+[a-zA-Z]+"
                Display="Dynamic"
                ErrorMessage="Password must be 8 characters and have both letters and numbers." />
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="lblPass2" runat="server" Text="Confirm: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:TextBox ID="txtNewPass2" TextMode="Password" Width="200" runat="server"></asp:TextBox>
                </div>
            </div>
            <div class="row">
                <div class="col col_3">
                    <asp:Label ID="lblNewMail" runat="server" Text="Mail: "></asp:Label>
                </div>
                <div class="col col_3">
                    <asp:TextBox ID="txtNewMail" Width="200" runat="server"></asp:TextBox>
                </div>
            </div>
             <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtNewMail"
                    ErrorMessage="Not a Valid Email Address" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                    ValidationGroup="CreateUserForm"></asp:RegularExpressionValidator>
            <div class="row">
                <div class="col col_3">
                    <asp:Button ID="CreateUser" runat="server" Text="Create User" OnClick="createUser_Click" />
                </div>
            </div>
            <div class="row">
                <div class="col col_16">
                    <hr />
                </div>
            </div>
        </asp:Panel>
    </asp:Panel>
</asp:Content>
